﻿
using Bootstrap5.Abstractions;

using Microsoft.AspNetCore.Components;

namespace Bootstrap5;

/// <summary>
/// Represents a interactive controls for web-based forms in order to accept data from the user as &lt;input> element.
/// </summary>
/// <typeparam name="TValue">The type of value.</typeparam>
public class FormInputText<TValue>:FormInputBase<TValue>
{
	/// <summary>
	/// A styled as plain text to remove the default form field styling and preserve the correct margin and padding.
	/// </summary>
	[Parameter] [CssClass("form-control-plaintext")] public bool Texted { get; set; }
	/// <summary>
	/// The size of control.
	/// </summary>
	[Parameter] [CssClass("form-control-")] public Size? Size { get; set; }

	protected override string Type => "text";

	protected override void CreateCssClass(ICssClassBuilder builder)
    {
		builder
			.Add("form-control", !Texted)
			.Add("form-control-plaintext", Texted)
			;
    }
}